
//	------------------------------------------------------------------------------
//                                       _                          
//              _ __ ___   ___ _ __ ___ | |__  _ __ __ _ _ __   ___ 
//             | '_ ` _ \ / _ \ '_ ` _ \| '_ \| '__/ _` | '_ \ / _ \
//             | | | | | |  __/ | | | | | |_) | | | (_| | | | |  __/
//             |_| |_| |_|\___|_| |_| |_|_.__/|_|  \__,_|_| |_|\___|
//                                                     
//	------------------------------------------------------------------------------

#region - License -
//
//	------------------------------------------------------------------------------                                                   
//	         Copyright (c) 2010 Peter Vyvey (peter.vyvey@chiliware.be)
//	------------------------------------------------------------------------------
//
//
//	This file is part of CHILIWARE MEMBRANE.
//
//	CHILIWARE MEMBRANE is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	CHILIWARE MEMBRANE is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU Lesser General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public License
//	along with CHILIWARE MEMBRANE.  If not, see <http://www.gnu.org/licenses/>.
//
//
#endregion

#region - Changes -
//
//	peter.vyvey@chiliware.be		2010-08-09		Created
//
#endregion

#region - Using -

using System.Configuration;

#endregion

namespace Chiliware.Membrane.Configuration
{
	#region - Preloader -

	/// <summary>
	/// The preloader configuration section.
	/// </summary>
    public sealed class Preloader : ConfigurationElement
	{
		#region - Constructors -

		/// <summary>
		/// Default constructor.
		/// </summary>
		public Preloader()
		{
			base.Properties.Add(new ConfigurationProperty(Preloader.TYPE_CONFIGURATION_PROPERTY, typeof(string), null, ConfigurationPropertyOptions.IsRequired));
			base.Properties.Add(new ConfigurationProperty(Preloader.METHOD_CONFIGURATION_PROPERTY, typeof(string), null, ConfigurationPropertyOptions.IsRequired));
		}

		#endregion

		#region - Constants & static fields -

		/// <summary>
		/// The name of the TYPE configuration property.
		/// </summary>
		private const string TYPE_CONFIGURATION_PROPERTY = "type";

		/// <summary>
		/// The name of the METHOD configuration property.
		/// </summary>
		private const string METHOD_CONFIGURATION_PROPERTY = "method";

		#endregion

		#region - Properties -

		/// <summary>
		/// The type of preloader.
		/// </summary>
        [ConfigurationProperty(Preloader.TYPE_CONFIGURATION_PROPERTY)]
		public string Type
		{
            get { return (string)base[Preloader.TYPE_CONFIGURATION_PROPERTY]; }
            set { base[Preloader.TYPE_CONFIGURATION_PROPERTY] = value; }
		}

		/// <summary>
		/// The method to execute.
		/// </summary>
		[ConfigurationProperty(Preloader.METHOD_CONFIGURATION_PROPERTY)]
		public string Method
		{
			get { return (string)base[Preloader.METHOD_CONFIGURATION_PROPERTY]; }
			set { base[Preloader.METHOD_CONFIGURATION_PROPERTY] = value; }
        }

		#endregion
	}

	#endregion
}
